package net.knightwatch.kwtools.database;

import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;

public class AutoCompleteAnswersTable {
	private static final String TAG = "AutoCompleteAnswersTable";
	public static final String TABLE_AUTOCOMPLETE_ANSWERS = "AutoCompleteAnswers";
	public static final String COLUMN_ID = "_id";
	public static final String COLUMN_ANSWER_ID = "answerId";
	public static final String COLUMN_ANSWER_TEXT = "answerText";
	// Database create script
	private static final String DATABASE_CREATE = "CREATE TABLE "
			+ TABLE_AUTOCOMPLETE_ANSWERS
			+ " ( "
			+ COLUMN_ID + " integer primary key autoincrement,"
			+ COLUMN_ANSWER_ID + " integer not null,"
			+ COLUMN_ANSWER_TEXT + " text not null"
			+ ");";
	
	public static void onCreate(SQLiteDatabase database) {
		
		try {
			Log.i(TAG, DATABASE_CREATE);
			database.execSQL(DATABASE_CREATE);
		} catch (SQLException e) {
			// Catch error for TextAnswersTable
			Log.e(TAG, "Unable to create table.");
			e.printStackTrace();
		} finally {
			Log.i(TAG, "Table created.");
		}
	}
	public static void onUpgrade(SQLiteDatabase database, int oldVersion, int newVersion){
		
	}
}
